package cn.oracle.eshop.auth.domain;

import cn.oracle.eshop.comment.util.BeanCopierUtils;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;

import java.util.Date;

/**权限DTO类
 * @author wyh
 * @ClassName PriorityDo
 * @date 2022/1/12 /21:39
 */
@Data
@Slf4j
public class PriorityDTO {
    /**id*/
    private Long id;
    /**权限编号*/
    private String code;
    /**权限Url*/
    private String url;
    /**权限备注*/
    private String priorityComment;
    /**权限类型*/
    private Integer priorityType;
    /**父权限的Id*/
    private Long parentId;
    /**权限的创建时间*/
    private Date gmtCreate;
    /**权限的修改时间*/
    private Date gmtModified;
    public <T> T clone(Class<T> clazz) {
        T target = null;

        try {
            target= clazz.newInstance();
        } catch (Exception e) {
            log.error("PriorityDTO中克隆对象的时候出错:{}", e);
        }
        BeanCopierUtils.copyProperties(this, target);
        return target;
    }
}
